1. Field of the Invention
The present invention relates to data processing systems and in particular to a system in which a central processing unit has a register file for storage of often-used data to minimize the need for relatively slower accessing of a main memory of the system. More particularly, it relates to the circumstance when contents of the register file have to be saved in a main memory, and then restored therefrom, and a method of minimizing the saving and restoring of the contents of the register file in and from the main memory.
2. Description of the Prior Art
Since registers are lower in access cost than memories, the effective utilization of registers is a key design goal for enhancement of the program processing speed of a processor. However, the number of the registers that can be employed is finite.
Various systems and methods have been devised in an effort to effectively utilize the registers of a register file. For example, the system disclosed in U.S. Pat. No. 4,777,588 allocates a variable number of registers to a particular procedure that is limited to only the number that is actually required by the procedure. In addition, register classes are defined so that communication may occur between multiple procedures via variables stored in a set of "global" registers while variables required for a given procedure are stored in a set of "local" registers. Local registers may be disposed so that a set of registers used by a calling procedure overlap with the set of registers used by the called procedure. This allows convenient passing of parameters from the calling procedure to the called procedure. A stack pointer value stored in one of the register sets defines accesses to the local registers of the set. Adjusting the stack pointer values can produce the overlap so that the procedures can communicate via the registers in common. In a multi-tasking environment, to proscribe access to selected registers containing values set by a task, during the running of other tasks, a protection register is provided which contains data indicating a denial of access to a block of the register file in which the selected registers are included. Accordingly, the system can use the register file to operate on multiple tasks while maintaining the integrity of the variables of each from undesired changes occurring in the others.
A register file comprised of a plurality of register sets made up of a number of local registers is also disclosed in U.S. Pat. No. 4,811,208. At a call instruction, a register set from the file is allocated to the called procedure. At a return instruction, the allocated register set is freed for allocation to another procedure called by a subsequent call instruction. If the register file is depleted, the contents of a register set associated with a previous procedure is saved in the main memory, and that register set is allocated to the current procedure. The contents of the earlier procedure's register set is mapped into a stack frame. Unfortunately, there is no teaching or reference to a mechanism for especially storing the registers. Neither the timing of the storing or whether or how to restore is identified.